<?php
require_once 'databaseconnection.php';
$username=$_POST['username'];
$password=$_POST['password'];
$passwordmd5=md5($password);
$queryres=mysql_query("SELECT * FROM user WHERE Login_Username='$username' AND Password='$passwordmd5'");
if($queryres)
{
if($row=mysql_fetch_array($queryres))
  {
	$_SESSION['First_Name']=$row['First_Name'];
	$_SESSION['Last_Name']=$row['Last_Name'];
	$_SESSION['Access_Type']=$row['Access_Type'];
	$_SESSION['NIC_Number']=$row['NIC_Number'];
	$_SESSION['Mail_Id']=$row['E_Mail'];
}
}
		else
{
	$_SESSION['error1']="Incorrect username or password!";
}
if(authanti($username,md5($password)))
{
	session_start();
	$_SESSION['username']=$username;
	$_SESSION['password']=$password;	
}
else
{
	$_SESSION['error1']="Incorrect username or password!";
}
?>